<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>就行天下</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <!--weui.min.css-->
    <link rel="stylesheet" type="text/css" href="/static/index/css/page/weui.min.css">
    <!--jquery-weui.min.css-->
    <link rel="stylesheet" type="text/css" href="/static/index/css/page/jquery-weui.min.css">
    <link rel="stylesheet" href="/static/index/css/page/base.css" />
    <link rel="stylesheet" type="text/css" href="/static/index/css/page/font.css"/>
    <link rel="stylesheet" type="text/css" href="/static/index/css/page/index.css"/>
</head>
<body>
<div class="pageControl">
    <div>
        <img src="/static/index/img/j8.png" alt="">
    </div>
    <div class="money">
        <div class="money-list">
            <a href="" class="">
                <img src="/static/index/img/j7.png" alt="">
                <p class="text-center cl-f">1个</p>
            </a>
            <a href="">
                <img src="/static/index/img/j7.png" alt="">
                <p class="text-center cl-f">5个</p>
            </a>
            <a href="">
                <img src="/static/index/img/j7.png" alt="">
                <p class="text-center cl-f">10个</p>
            </a>
            <a href="">
                <img src="/static/index/img/j7.png" alt="">
                <p class="text-center cl-f">100个</p>
            </a>
        </div>
        <div class="moneyRow ">
            <div class="money1 text-center pl">
                <span class="cl-cc6">元宝数: </span>
                <input type="text" class="money1-input" value="{$figure}">
            </div>
            <div class=" text-center pl money2">
                <span class="cl-cc6">充值: </span>
                <input type="text" class="money1-input recharge_figure" value="">
                <a href="javascript:;" class="money1Btn"></a>
            </div>
            <a class="money-fa" href="javascript:;">
                <img src="/static/index/img/jj2.png" alt="">
            </a>
        </div>
        
    </div>

</div>
<script type="text/javascript" src="/static/index/js/page/jquery-2.1.4.js"></script>
<script type="text/javascript" src="/static/index/js/page/jquery-weui.min.js"></script>
<script>
$(function () {
	var count=0;
    $('.money-list').on('click','a',function (e) {
        e.preventDefault();
        var that=$(this);
        that.addClass('active').siblings().removeClass('active');
        count = that.find('p').html();
    	count=parseFloat(count);
    })
    
    $('.money-fa').on('click',function(){
		$.post(
			"/index/index/give",
			{count:count},
			function(data){
				data = JSON.parse(data);
				if(data.code){
					alert(data.msg);
				}
			}
		)
	})
    /*
     *元宝充值 
     * */
    $('.money1Btn').click('click',function(){
    	var figure = $('.recharge_figure').val();//充值元宝数
        var money = figure*1;
    	$.post(
    		"/index/Wpay/jsapi",
    		{money:money},
    		function(data){
                console.log(data);
    		}
    	)
    })
    	
})
</script>
</body>
</html>

